home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ MSOXP User Places 3.xpl < prev    next >
Text File  |  2004-01-29  |  2KB  |  84 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="4"
  3. "COUNT"="2"
  4. "UIPATH"="Program Options\Microsoft Office\MS Office XP\Open/Save Dialog\User Defined Place 3"
  5. "NAME"="Name and Path"
  6. "VERSION"="1.10"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Place Name"
  9. "TEXT 2"="Exact Path"
  10. "DESCRIPTION 1"="Microsoft Office has an "Places Bar" on the left side of its Open/Save dialog."
  11. "DESCRIPTION 2"="You can also add you own folders to this bar. First enter a name for the folder (in "Name"), then enter the exact path to this item (in "Path")."
  12. "DESCRIPTION 3"="To remove a user-defined value, simply clear both fields and apply your changes.
  13. "AUTHOR"="Xteq Systems"
  14. "CONTACTURL"="http://www.xteq.com"
  15. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  16. "COMMENT 1"="Thanks to Nat Gildersleeve [natgild@netptc.net] for the left vs. right bug notice!"
  17. "COMMENT 2"=" "
  18.  
  19.  
  20.  
  21.  
  22. sPlaceNameID=3
  23. sPCheck="HKCU\Software\Microsoft\Office\10.0\"
  24. sP1=sPCheck & "Common\Open Find\Places\UserDefinedPlaces\Place" & sPlaceNameID & "\"
  25.  
  26.  
  27. Sub Plugin_Initialize 
  28. if RegPathExists(sPCheck) then
  29.    s=RegReadValue(sP1+"Name")
  30.    Call SetUIElement(1,s)
  31.  
  32.    s=RegReadValue(sP1+"Path")
  33.    Call SetUIElement(2,s)
  34. else
  35.  Call Disable()
  36. end if
  37. End Sub
  38.  
  39. Sub Plugin_CheckData(ElementIndex)
  40. End Sub
  41.  
  42. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  43.  s=GetUIElement(1)
  44.  s2=GetUIElement(2)
  45.  Call SetIt(sP1,s,s2)
  46.  
  47.  
  48. End Sub
  49.  
  50. Sub SetIt(Path,Name,Folder)
  51.  if len(Name)>0 then
  52.     'set it
  53.     Call RegWriteValue(Path+"Name",Name,1)    
  54.     Call RegWriteValue(Path+"Path",Folder,1)
  55.  
  56.     Call Logoff
  57.  else
  58.     'remove it....
  59.     s=RegReadValue(Path+"Name")
  60.     if IsEmpty(s)=false then
  61.        'value set... remove it!
  62.        cnt=RegEnumValues(Path)
  63.  
  64.        for i=1 to cnt  
  65.            sName=RegEnumElement(i)
  66.            Call RegDeleteValue(Path+sName) 
  67.        next 
  68.  
  69.        Call RegDeletePath(path)
  70.  
  71.        Call MsgInformation("User defined place removed!")
  72.        Call Logoff
  73.     end if
  74.  end if
  75.  
  76. end sub
  77.  
  78.  
  79.  
  80.  
  81.  
  82. Sub Plugin_Terminate 
  83. End Sub
  84.